from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.utils import MyNumbPage
from django.contrib.auth.models import Permission, ContentType
from .serializers import PremissionSerializer, ContentTypeSerializer


class PremissionViewSet(ModelViewSet):
    serializer_class = PremissionSerializer
    queryset = Permission.objects.order_by('id').all()
    pagination_class = MyNumbPage


class ContentTypeView(ListAPIView):
    serializer_class = ContentTypeSerializer
    queryset = ContentType.objects.all()


